home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlStatusBarGetText.au3 < prev    next >
Text File  |  2007-09-08  |  2KB  |  44 lines

  1. Opt("MustDeclareVars", 1)
  2.  
  3. #include <GUIConstants.au3>
  4. #Include <GuiStatusBar.au3>
  5.  
  6. Local $gui, $StatusBar1, $msg, $lbl_Info
  7. Local $a_PartsRightEdge[3] = [100, 350, -1]
  8. Local $a_PartsText[3] = ["New Text", "More Text", "Even More Text"]
  9.  
  10. ;================================================================
  11. ; Example 1 - Using AutoIt Control
  12. ;================================================================
  13. $gui = GUICreate("Status Bar Get Text", 500, -1, -1, -1, $WS_SIZEBOX)
  14. $lbl_Info = GUICtrlCreateLabel("", 10, 10, 150, 50, $SS_SUNKEN)
  15. $StatusBar1 = _GUICtrlStatusBarCreate($gui, $a_PartsRightEdge, $a_PartsText)
  16.  
  17. GUICtrlSetData($lbl_Info, "1st Part: " & _GUICtrlStatusBarGetText($StatusBar1, 0) & @LF & _
  18.         "2nd Part: " & _GUICtrlStatusBarGetText($StatusBar1, 1) & @LF & _
  19.         "3rd Part: " & _GUICtrlStatusBarGetText($StatusBar1, 2))
  20.  
  21. GUISetState(@SW_SHOW)
  22.  
  23.  
  24. While 1
  25.     $msg = GUIGetMsg()
  26.     Select
  27.         Case $msg = $GUI_EVENT_RESIZED
  28.             _GUICtrlStatusBarResize($StatusBar1)
  29.         Case $msg = $GUI_EVENT_CLOSE
  30.             ExitLoop
  31.         Case Else
  32.             ;;;;;
  33.     EndSelect
  34.     
  35. WEnd
  36.  
  37. ;================================================================
  38. ; Example 2 - External Control
  39. ;================================================================
  40. Opt("WinTitleMatchMode", 4)
  41. Local $h_win = WinGetHandle("classname=SciTEWindow")
  42. Local $h_status = ControlGetHandle($h_win, "", "msctls_statusbar321")
  43. Local $v_rect = _GUICtrlStatusBarGetText($h_status)
  44. ConsoleWrite("Text: " & _GUICtrlStatusBarGetText($h_status) & @LF)